{% extends 'base/base.html' %}
{% block title %}
    首页
{% endblock %}



{% block css %}
    <style>
    .author_name{
        float:right;
        margin-right: 20px;
        color: #231dff;
    }
    .author_name1{
        float:right;
        margin-right: 10px;
    }
    </style>
{% endblock %}


{% block main %}
    {#        <a class="btn btn-success" href="{% url 'main:article_create' %}" role="button">写文章</a>#}
{#    {{ object_list }}#}
    {#    {{ is_paginated }}#}
    {#    {{ paginator }}#}
    {#    {{ page_obj.has_previous }}#}


    <ul class="list-group">
        {% for article in object_list %}
            <li class="list-group-item">
                <a href=" {% url 'main:files_detail' article.id %}">{{ article.title }}</a>
               <a class="author_name " href="">{{ article.author }}</a> <span class="author_name1 ">上传人：</span>
            </li>
        {% endfor %}
    </ul>

    <h1>files_list</h1>

    {% if object_list|length > 0 %}

        <nav aria-label="Page navigation">
            <ul class="pagination">
                {% if page_obj.has_previous %}
                    <li>
                    <a href="?page={{ page_obj.previous_page_number }}" aria-label="Previous">
                {% else %}
                    <li class="disabled">
                    <a href="#" aria-label="Previous">
                {% endif %}

                <span aria-hidden="true">&laquo;</span>
                </a>
                </li>


                {% for pn in paginator.page_range %}
                    {% if pn != page_obj.number %}
                        <li><a href="?page={{ pn }}&category={{ category }}">{{ pn }}</a></li>
                    {% else %}
                        <li class="disabled"><a href="?page={{ pn }}&category={{ category }}">{{ pn }}</a></li>
                    {% endif %}
                {% endfor %}


                {% if page_obj.has_next %}
                    <li>
                    <a href="?page={{ page_obj.next_page_number }}" aria-label="Next">
                {% else %}
                    <li class="disabled">
                    <a href="#" aria-label="Next">
                {% endif %}

                <span aria-hidden="true">&raquo;</span>
                </a>
                </li>
            </ul>
        </nav>
    {% endif %}



{% endblock %}
